<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">

<section class="content-header">
    <h1>
        还料查看<span th:text="${status}">（已还完）</span>
    </h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-header">
                    <div class="col-md-12">
                        <h3>串料出库基本信息</h3>
                    </div>
                </div>
                <div class="box-body">
                    <div class="row">
                        <div class="col-md-12">
                            <form id="lendForm" method="post" class="form-horizontal" role="form">
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">串料申请单号</label>
                                    <div class="col-sm-10">
                                        <span th:text="${lend.lendCode}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">需求项目</label>
                                    <div class="col-sm-10">
                                        <span th:text="${lend.needProCode + '&nbsp&nbsp&nbsp&nbsp' + lend.needProName}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">计划归还编码</label>
                                    <div class="col-sm-10">
                                        <span th:text="${lend.needTrackCode}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">需求物料描述</label>
                                    <div class="col-sm-10">
                                        <span th:text="${lend.needMaterialDesc}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">需求数量</label>
                                    <div class="col-sm-1">
                                        <span th:text="${lend.needQty+lend.needMaterialBase.numUnit}"></span>
                                    </div>
                                    <label class="col-sm-1 text-right">需求重量</label>
                                    <div class="col-sm-1">
                                        <span th:text="${lend.needWgt+lend.needMaterialBase.weightUnit}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">使用部门</label>
                                    <div class="col-sm-10">
                                        <span th:text="${lend.needDepartment}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">挪用项目</label>
                                    <div class="col-sm-10">
                                        <span th:text="${lend.lendProCode+ '&nbsp&nbsp&nbsp&nbsp' +lend.lendProName}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">挪用计划编码</label>
                                    <div class="col-sm-10">
                                        <span th:text="${lend.lendTrackCode}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">挪用物料描述</label>
                                    <div class="col-sm-10">
                                        <span th:text="${lend.lendMaterialDesc}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">实际挪用数量</label>
                                    <div class="col-sm-1">
                                        <span th:text="${lend.outQty+lend.needMaterialBase.numUnit}"></span>
                                    </div>
                                    <label class="col-sm-1 text-right">实际挪用重量</label>
                                    <div class="col-sm-1">
                                        <span th:text="${lend.outWgt+lend.needMaterialBase.weightUnit}"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 text-right">是否需要还料</label>
                                    <div class="col-sm-4">
                                        <span th:text="${lend.returnFlg == 1}?'需要还':'无需还'"></span>
                                    </div>
                                    <div class="col-sm-2">
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <table id="returnMaterialTable" class="table table-bordered table-hover" width="100%">
        <thead>
        <tr>
            <th>序号</th>
            <th>项目编号</th>
            <th>项目名称</th>
            <th>计划编码</th>
            <th>物料描述</th>
            <th>数量</th>
            <th>单位</th>
            <th>重量</th>
            <th>单位</th>
            <th>备注</th>
            <th>还料日期</th>
            <th>还料人</th>
        </tr>
        </thead>
    </table>
</section>
<div th:include="include :: footer"></div>

<script>

    $(function () {

        // 还料列表
        $.table.init({
            id: "returnMaterialTable",
            info: true,
            url: ctx + "mm/returnmaterial/project/list/",
            data: {
                id: [[${lend.id}]]
            },
            columns: [
                {
                    data: null,
                    render: function (data, type, row, meta) {
                        return meta.row + 1 + meta.settings._iDisplayStart;
                    }
                },
                {data: "materialStockDetail.projectCode"},
                {data: "materialStockDetail.projectName"},
                {data: "materialStockDetail.trackCode"},
                {data: "materialDesc"},
                {data: "returnQty"},
                {data: "materialStockDetail.materialBase.numUnit"},
                {data: "returnWgt"},
                {data: "materialStockDetail.materialBase.weightUnit"},
                {data: "remark"},
                {data: "operateDate"},
                {data: "operateUser"}
            ]
        })

    });
</script>

</body>
</html>